$(function(){
    $("#all-page").on("tap",function(){
        if($(".fixed-box[id='reg-div']").css("display") == "block"){
            return;
        }
        $(this).hide();
        $(".fixed-box").css("display","none");
        $(".share-hint").css("display","none");
    });
    $("#adv-btns .lp").on("tap",function(){
        $("#all-page").show()
        $(".share-hint").css("display","block");
    })
    $(".que-btn").on("tap",function(){
        var parent = $(this).parents(".fixed-box");
        if(parent.attr("data-loca")){
            //var code = getCookie("youchi_code");
            window.location = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd57f9e1293806c90&redirect_uri=http://wx.youchi365.com/register.php&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
            return;
        }
        parent.css("display","none");
        $("#all-page").hide();
    });
})

function getCookie(name){
    var curCookie = decodeURIComponent(document.cookie);
    var cookieName = name+"=";
    var start = curCookie.indexOf(cookieName);
    var end  = curCookie.indexOf(";",start);
    if(end < 0){
        end = curCookie.length;
    }

    return curCookie.substring(start+cookieName.length,end);
}
function unCookie(str){
    document.cookie = str +"=; expires ="+new Date(0);
}